trapezoidal rule of numerical integration